/*
 * World.h
 *
 *  Created on: 20 Dec 2011
 *      Author: mohab
 */

#ifndef WORLD_H_
#define WORLD_H_

#include "Enums.h"
#include "Commands.h"

#include <list>
using namespace std;

// Represents a set of pucks grouped according to their type
struct Pucks
{
	list<int> S0;			// A list of S0 pucks
	list<int> S1;			// A list of S1 pucks
	list<int> S2;			// A list of S2 pucks
	list<int> Products;		// A list of Product pucks
	list<int> Consumed;		// A list of consumed pucks
	list<int> ExpressGood;	// A list of Express Good pucks
};

// Represents a single Puck
struct Puck
{
	int location;//constants to be shared with motion planning
	int state;
};

// Represents the contents of a Machine
/*struct MachineContents
{
	int S0 = 0,				// Number of S0 pucks in a machine
		S1 = 0,				// Number of S1 pucks in a machine
		S2 = 0,				// Number of S2 pucks in a machine
		Products = 0,		// Number of Product pucks in a machine
		Consumed = 0;		// Number of Consumed pucks in a machine
};*/

struct Machine
{
	int number;				// ID number of the machine. Ideally should be unique.
	Enums::MachineType type;		// The type of the machine.
	Enums::WorkState state;		// The current state of the machine.
	Pucks contents;			// Pucks currently in the machine.
};

struct DeliveryGate
{
	int Active;				// ID number of the active gate.
};

class World
{
public:
	World();

	void Init();
	void Update();

	//Pucks pucks;
	Puck* pucks;
	Machine * machines;				// All the machines in this world.
	DeliveryGate deliveryGate;		// Active Delivery Gate in this world.
};

#endif /* WORLD_H_ */
